﻿<%@ Page Language="C#" MasterPageFile="~/Layouts/Form.Master" AutoEventWireup="true" CodeBehind="OperationRuleEdit.aspx.cs" Inherits="Bingosoft.WebApp.Modules.SecurityConsole.Privilege.OperationRuleEdit" %>

<asp:Content ContentPlaceHolderID="head" ID="idFormTitle" runat="server">
        <title><%=Request["title"]%></title>
</asp:Content>
<asp:Content ContentPlaceHolderID="Content" ID="idFormMain" runat="server">
    <!-- 页面头部 -->
	<div class="header">
	     <h1><%=Request["title"]%></h1>
	</div>

    <web:SmartFormView ID="SmartFormView1" runat="server" DataKeyNames="Id" DataSourceID="SmartDataSource1"
        Width="100%">        
        <InsertItemTemplate></InsertItemTemplate>
        <EditItemTemplate></EditItemTemplate>
        <ItemTemplate>
          <asp:HiddenField ID='Id' runat='server' Value='<%# Bind("Id") %>' />
          <asp:HiddenField ID='OperationId' runat='server' Value='<%# Bind("OperationId") %>' />
          <div>
            <table cellpadding='2' cellspacing='1' width='100%' class="formitem">
                <caption>所属操作：<%=Request.Params["OperationName"]%></caption>
                <tr>
                    <th>                        
                        规则名称:<font color='red'>*</font>
                    </th>
                    <td>
                        <asp:TextBox ID="Name" runat="server" Text='<%# Bind("Name") %>'  Width='90%' 
                        validator="required,length[1,150]"></asp:TextBox>                        
                    </td>
                </tr>                         
                <tr>
                    <th>
                        优先级:<font color='red'>*<ont>
                    </th>
                    <td>
                        <asp:TextBox ID='Priority' runat='server' Text='<%# Bind("Priority") %>' Width='90%'
                            validator="required,integer"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        规则表达式:
                    </th>
                    <td>              
                       <asp:TextBox TextMode="MultiLine" Rows="5" Columns="54" ID='Rule' runat='server' Text='<%# Bind("Rule") %>' validator="length[1,1000]" Width='90%'></asp:TextBox>                                                                
                    </td>
                </tr>
                <% if (!String.IsNullOrEmpty(Request["ElementId"]))
                   {%>     
                <tr>
                    <th>
                        行为:
                    </th>
                    <td>
                        <asp:RadioButtonList ID='Behaviour' runat='server' SelectedValue='<%# Bind("Behaviour") %>' RepeatDirection="Horizontal">
                            <asp:ListItem Text="可见可读" Value="" Selected="True" />
                            <asp:ListItem Text="不可见" Value="invisible" />
                            <asp:ListItem Text="只读" Value="disabled" />
                        </asp:RadioButtonList>                         
                    </td>
                </tr>
                <%
                   }%>
                <tr>
                    <th>
                        备注:
                    </th>
                    <td>              
                       <asp:TextBox TextMode="MultiLine" Rows="5" Columns="54" ID='Description' runat='server' Text='<%# Bind("Description") %>' validator="length[1,1000]" Width='90%'></asp:TextBox>                                                                
                    </td>
                </tr>                      
            </table>
        </div>
        </ItemTemplate>
    </web:SmartFormView>
    
    <web:SmartSqlDataSource ID="SmartDataSource1" runat="server" SelectCommand="privilege.operation.rule.select"
    InsertCommand="privilege.operation.rule.insert" UpdateCommand="privilege.operation.rule.update"
     SelectCommandAutoPageWrap="false">
    </web:SmartSqlDataSource>

    <!-- 页脚区域 -->
	<div class="footer">
		<asp:Button runat="server" Text="确定" 
            OnClientClick="return validateForm();" onclick="SaveOperationRule"/>        
        <asp:Button ID="CloseButton2" runat="server" Text="关闭" OnClientClick="return closeForm();" />        
	</div>
</asp:Content>

